<script lang="ts">
import { defineComponent, ref, watch } from "vue";

export default defineComponent({
  props: [
    'hightlightData'
  ],
  setup(props) {
    const hightlightData = ref() as any
    hightlightData.value = props.hightlightData
    watch(() => props.hightlightData, (val: any) => {
      hightlightData.value = val
    })
    return {
      hightlightData,
    }
  }
})
</script>

<template>
  <div class="content pcshow">
    <div class="highlightTitle bigTitle">功能介绍</div>
    <div class="highlightContent" v-for="(item, index) in hightlightData" :key="index">
      <div class="highlightLeft" v-if="index % 2 == 0">
        <div class="highlightLeftText">
          <div class="LeftTextTitle secondTitle">{{ item.title }}</div>
          <div class="LeftTextDemand contentText">{{ item.desc }}</div>
        </div>
        <div class="highlightLeftImg scaleImgCard">
          <img :src="item.cover_image" alt="" />
        </div>
      </div>
      <div class="highlightRight" v-else>
        <div class="highlightRightImg scaleImgCard">
          <img :src="item.cover_image" alt="" />
        </div>
        <div class="highlightRightText">
          <div class="RightTextTitle secondTitle">{{ item.title }}</div>
          <div class="RightTextDemand contentText">{{ item.desc }}</div>
        </div>
      </div>
    </div>
  </div>
  <div class="content sjshow">
    <div class="highlightTitle bigTitle">方案介绍</div>
    <div class="highlightContent" v-for="(item, index) in hightlightData" :key="index">
      <div class="highlightRight">
        <div class="highlightRightImg scaleImgCard">
          <img :src="item.cover_image" alt="" />
        </div>
        <div class="highlightRightText">
          <div class="RightTextTitle secondTitle">{{ item.title }}</div>
          <div class="RightTextDemand contentText">{{ item.desc }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
@import url("@/assets/css/content.css");

.pcshow {
  display: block;
}

.sjshow {
  display: none;
}

.content {
  margin: 0 auto;
  // padding: 0 20px;

  .highlightTitle {
    padding: 60px 0 40px 0;
    text-align: center;
  }

  .highlightContent {
    padding: 40px 0 60px 0;

    .highlightLeft {
      display: flex;
      height: 380px;

      .highlightLeftText {
        width: 50%;
        // margin-left: 30px;
        padding: 0 80px 0 0;

        .LeftTextTitle {
          padding: 40px 0;
        }
      }

      .highlightLeftImg {
        width: 50%;
        height: 100%;
        border-radius: 20px;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          border-radius: 20px;
        }
      }
    }

    .highlightRight {
      display: flex;
      height: 380px;

      .highlightRightImg {
        width: 50%;
        height: 100%;
        border-radius: 20px;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          border-radius: 20px;
        }
      }

      .highlightRightText {
        width: 50%;
        padding: 0 0 0 80px;

        .RightTextTitle {
          padding: 40px 0;
          font-weight: 500;
        }

      }
    }
  }
}

@media screen and (max-width: 768px) {
  .pcshow {
    display: none;
  }

  .sjshow {
    display: block;
  }

  .content {
    margin: 0 auto;
    padding: 0 30px;

    .highlightTitle {
      padding: 30px 0 0 0;
      text-align: left;
      padding-left: 0px;
    }

    .highlightContent {
      padding: 30px 0px;

      .highlightRight {
        flex-direction: column;
        height: auto;

        .highlightRightImg {
          width: 100%;
        }

        .highlightRightText {
          width: 100%;
          padding: 0;

          .RightTextTitle {
            padding: 26px 0;
          }
        }
      }
    }
  }
}
</style>